
/**
 * [toDecimal 强制在数字后面增加小数位数]
 * @param  {[Number]} number [要转换的数字]
 * @param  {[Number]} float  [需要添加几位小数]
 * @return {[String]}        [返回转换后的字符串数字]
 */
export function toDecimal(number, float) {
    if (isNaN(number)) {
        return false;
    }
    float = float || 2;
    number = parseFloat(number, float).toString();
    let rs = number.indexOf('.');

    if (rs < 0) {
        rs = number.length;
        number += '.';
    }
    while (number.length <= rs + float) {
        number += '0';
    }

    return number;
}